package com.aluka.nirvana.framework.wechat.mina.model;

import com.aluka.nirvana.framework.wechat.mina.constant.MinaCommonConstant;
import lombok.Data;

/**
 * 微信小程序服务端接口响应基类
 * @author gongli
 * @since 2020/4/7 19:14
 */
@Data
public abstract class MinaBasicResponse {

    /**
     * 错误码
     */
    private int errcode;

    /**
     * 错误信息
     */
    private String errmsg;


    /**
     * 解析响应体，判断请求是否成功
     * @return java.lang.Boolean 成功与否
     */
    public Boolean isSuccess(){
        return MinaCommonConstant.SUCCESS_CODE == this.errcode;
    }

}
